{% extends 'cms/base.html' %}
{% block title %}
    板块管理
{% endblock %}
{% block page_title %}
    板块管理
{% endblock %}
{% block head %}
    <script src="{{ url_for('static', filename="cms/js/board.js") }}"></script>
{% endblock %}
{% block main_content %}
    <div class="top-box">
        <button class="btn btn-warning" id="add-board">添加板块</button>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>板块名称</th>
                <th>帖子数量</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for board in boards %}
                <tr>
                    <td class="border-name">{{ board.name }}</td>
                    <td>{{ board.threads | length }}</td>
                    <td>{{ board.create_time }}</td>
                    <td>
                        <button class="btn btn-default btn-xs modify-board" bdid="{{ board.id }}">修改</button>
                        <button class="btn btn-danger btn-xs delete-board" bdid="{{ board.id }}">删除</button>
                    </td>
                </tr>
            {% endfor %}

        </tbody>
    </table>
{% endblock %}